/**
 * 日报活信息页面
 * wangmei
 */
import React, { Component } from 'react';
import { Tabs } from 'antd';
import BreadcrumbCustom from '../../BreadcrumbCustom';
import DayPart from './DayPart'; //分部数据
import DaySum from './DaySum'; //汇总数据
import * as Constant from '../../../common/const';
import {objectIsNull} from '../../../common/utils';
require('../../systemManager/customer.css');

const TabPane = Tabs.TabPane;
let flag = true;
class Day extends Component{
    constructor(props) {
        super(props);
        this.state = {

        };
    }

    render(){
        let user = JSON.parse(localStorage.getItem('user'));
        let sysCompany = user.sysCompany;
        flag = objectIsNull(sysCompany);
        let state = flag && sysCompany.id==1;
        return(
            <div>
                <BreadcrumbCustom first={"卸载信息"} />
                {flag && <Tabs type="card">
                    {state&&<TabPane tab="汇总数据" key="1">
                        <DaySum />
                    </TabPane>}
                    <TabPane tab="分部数据" key="2">
                        <DayPart sysCompany={sysCompany} state={state}/>
                    </TabPane>
                </Tabs>}
                {!flag && <div>{Constant.STATISTICS_NO_PERMISSION}</div>}
            </div>
        )
    }
}

export default Day